import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Index from "./Index"
import router from './router'
import store from './store'
import axios from "axios"

if(process.env.VUE_APP_SERVER){
    axios.defaults.baseURL=process.env.VUE_APP_SERVER+"/mq"
}else{
    axios.defaults.baseURL=window.location.protocol+"//"+window.location.host+"/mq"
}
const app=createApp(Index)
app.config.globalProperties.$axios=axios
app.config.globalProperties.$websocketBaseUrl=axios.defaults.baseURL.replaceAll("http","ws").replace("mq","ws")

app.use(store).use(ElementPlus).use(router).mount('#app')
